package com.zyjlab.mqdemo.util;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MQSendUtil {
   @Autowired
   private AmqpTemplate template;



    /**
     * 向 rabbitmq 中发送一个消息队列
     */
   public void sendMsg(){
       template.convertAndSend("queue","hello world");
   }
}
